package com.woniuxy.service.impl;

import com.woniuxy.entity.User;
import com.woniuxy.mapper.UserMapper;
import com.woniuxy.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: linKe
 * @Date: 2021/11/24 11:52
 * @FileName: UserServiceImpl
 * @version: 1.0
 * @Description: 描述
 */
@Service
public class UserServiceImpl implements UserService {
    /**
     * 注入持久层
     */
    @Resource
    private UserMapper userMapper;

    @Override
    public int addUser(User user) {
       return userMapper.insert(user);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateById(user);
    }

    @Override
    public List<User> findUser(User user) {
        return userMapper.selectList(null);
    }

    @Override
    public int deleteUser(User user) {
        return userMapper.deleteById(user);
    }
}
